#include "headfiles.h"

using namespace std;

int main(int argc, char **argv) {
	if (argc != 3) {
		cout << "Usage: " << argv[0] << " node_file n" << endl;
		return 0;
	}

	char file_name[256];
	sprintf(file_name, "%s", argv[1]);
	
	int n;
	n = atoi(argv[2]);

	NODE *head;
	head = createLoopLinkList(file_name, n);

	NODE *node;
	node = findJointNode(head);

	if (node == NULL) {
		cout << "Find joint node error!" <<endl;
	}
	else {
		cout << "Joint node is" << node->val << endl;
	}

	cout << "Release link list: " << endl;
	releaseLoopLinkList(head);

	return 0;
}

